﻿using System;
using System.Collections.Generic;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
using Moq;
using Opo.Net.Mail;

namespace Opo.Perspective.Core
{
    [TestFixture]
    public class ContactInfoTests
    {
        string _type;
        string _street;
        string _cityName;
        string _postalCode;
        CityInfo _city;
        PhoneNumberCollection _phoneNumbers;
        MailAddressCollection _mailAddresses;

        [TestFixtureSetUp]
        public void Setup()
        {
            _type = "Type";
            _street = "Street";
            _cityName = "City";
            _postalCode = "12345";
            _city = new CityInfo(_cityName, _postalCode);
            _phoneNumbers = new PhoneNumberCollection() { new PhoneNumber("123456789"), new PhoneNumber("987654321") };
            _mailAddresses = new MailAddressCollection() { new MailAddress("mail1@example.org", "Email 1"), new MailAddress("mail2@example.org", "Email 2") };
        }

        [TestFixtureTearDown]
        public void Teardown()
        {

        }

        [Test]
        public void CanCreateContactInfo()
        {
            ContactInfo contactInfo = new ContactInfo(_type, _street, _city, _mailAddresses, _phoneNumbers);

            Assert.That(contactInfo.Type, Is.EqualTo(_type));
            Assert.That(contactInfo.Street, Is.EqualTo(_street));
            Assert.That(contactInfo.City.Name, Is.EqualTo(_cityName));
            Assert.That(contactInfo.City.PostalCode, Is.EqualTo(_postalCode));
            Assert.That(contactInfo.MailAddresses.Count, Is.EqualTo(2));
            Assert.That(contactInfo.PhoneNumbers.Count, Is.EqualTo(2));
        }
    }
}
